c# delete object

74

c# delete object -

Sample x = new Sample();
x.value = "Some Value";
// set object to null == "deleting" the object
x = null;
// this is going to throw a "NullReference" Exeption:
Console.WriteLine(x.value);

Comments

Submit
0 Comments